package test00.test06;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * @Author lzp
 * @Date 2024-04-02
 */
public class test {
    public static void main(String[] args) {
        String[] arr = new String[3];
        arr[0] = "aaa";
        arr[1] = "bbb";
        arr[2] = "ccc";
        System.out.println(Arrays.toString(arr));

        String[] newArr = new String[arr.length * 2];
        System.out.println(Arrays.toString(newArr));

        System.arraycopy(arr, 0, newArr, 0, arr.length);

        arr = newArr ;
        arr[3] = "DDD" ;
        System.out.println(Arrays.toString(newArr));
        System.out.println(Arrays.toString(arr));

    }
}
